import { Injectable } from '@angular/core';
import { RequestService } from '../../../cores/services/request.service';
import { ApiData } from '../../../cores/classes/api-data.class';
import { SearchParams } from '../../../cores/classes/search-params';
import { Recharge } from '../interface/recharge.interfaces';
import { Observable } from 'rxjs';
import { Pagination } from 'ng-tui';


@Injectable()
export class RechargeService {

    constructor(private request: RequestService) { }
    /**
        * 企业类型列表
        */
    searchypet(pagination: Pagination, search: SearchParams): Observable<ApiData> {
        return this.request.get('/managerapi/enterprise/type/list', pagination.getpageDataWith(search.values));
    }
    /**
     * 删除企业类型
     */

    del(id: number): Observable<ApiData> {

        return this.request.delete('/managerapi/enterprise/type/delete', { id });
    }

    /**
      * 添加类型列表
      * @param {Banner} banner 添加数据
      */
    inserttype(banner: Recharge): Observable<ApiData> {
        return this.request.post('/managerapi/enterprise/type/add', banner);
    }


    /**
    * 编辑企业类型
    * @param {Banner} banner 编辑
    */
    updatetype(banner: Recharge): Observable<ApiData> {
        return this.request.put(' /managerapi/enterprise/type/update', banner);
    }

}


